#pragma once

#include <QMainWindow>
#include <QMessageBox>

#include <QTimer>
#include <QSettings>
#include <QDir>
#include <QStandardPaths>

// Qt Network
#include <QTcpServer>
#include <QTcpSocket>
#include <QNetworkInterface>
#include <QHostInfo>

// Qt Xml
#include <QDomDocument>
#include <QXmlStreamWriter>

#include "header.h"
#include "clientinfo.h"
#include "tcpsocket.h"

namespace Ui {
    class Server;
}

class Server : public QMainWindow
{
    Q_OBJECT
protected:
    void closeEvent(QCloseEvent *) override;

public:
    explicit Server(QWidget *parent = nullptr);

private slots:
    void onNewConnection();

    void on_btnBound_clicked();
    void on_btnDisconnect_clicked();

private:
    Ui::Server *ui;
    QTcpServer *mServer;
    QList<TcpSocket*> mClients;
};
